/*
 * Created on Nov 12, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.user;

import java.util.Vector;
import org.apache.log4j.Logger;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.recruiter.user.CandidateInfo;
import org.vectrics.user.Person;
import org.vectrics.location.Address;

public class ResumeGenerator {
	private transient static Logger log = Logger.getLogger(ResumeGenerator.class);
	private Vector skillList = new Vector();

	public ResumeGenerator() {
		super();
		init();
	}

	private void init() {
		skillList.add("Java programming using object oriented design and analysis.");			
		skillList.add("C++ software development.  Build real time systems for military contractor.  Systems communicated with satellites through digital encrypted channels.  Experience with encryption algorithms including public key and symmetric key solutions");			
		skillList.add("Accountant with experience working in Big 6 firms.  Heavy experience with auditing.");			
		skillList.add("MBA degree with no real world experience.  Three years working in the restaurant business.");			
		skillList.add("Windows support technician.  Experience administering Windows NT authentication across large network.  Experience with Active Directories.");			
		skillList.add("Network engineer with Cisco experience.  Also responsible for configuring CheckPoint firewalls.  Provided support for complex network that included several NT domains in addition to HP-UX controlled domain.");			
		skillList.add("OOD (Object Oriented Design");			
		skillList.add("Technical Writing of user documentation for software products.");			
		skillList.add("Software Architecture - Expereince designing software using the unified process and Booch methodology.");			
		skillList.add("Requirements gathering for software products and services.  Worked with customers to provide software modifications needed to meet needs.");			
		skillList.add("Management of people and things.");			
		skillList.add("Project Management using Microsoft Project.  Have experience using Gantt charts and tracking budgets.");			
		skillList.add("J2EE using Weblogic, experience with WLI and WLS.  Developed applications designed to work in clustered environment.");			
		skillList.add("J2EE using WebSphere.  Experience tuning J2EE applications for performance.");			
		skillList.add("J2EE using JBoss.");			
		skillList.add("Software Engineering experience.  Test-driven-development, continuous integration, etc..");			
		skillList.add("Computer Science studies with emphasis on application development including SQL using ORM.");			
		skillList.add("JMS ansynchronous messaging with java, durable, queues, topics");			
		skillList.add("EJB - Session beans and some CMP EJB experience, though Hibernate was used as the ORM tool of choice.  Performed transactional configuration on session beans");			
		skillList.add("Used C++ to build embedded systems.  Used C++ STL to create high-throughput firmware for set-top boxes.");			
	}

	public String createRandomResume(CandidateInfo candidatePassed) {
		CandidateInfo candidate = RecruitServiceLocator.getRecruitUserService().findCandidateInfo(candidatePassed.getPerson());
		log.debug("createRandomResume() - user = " + candidate.getPerson().getName());
		StringBuffer resume = new StringBuffer(1000);
		int numberOfWords = (int)(Math.random() * skillList.size());
		if (numberOfWords < 4)
			numberOfWords = 6;
		int skillListSize = skillList.size();

		resume.append("Resume\n" + candidate.getPerson().getFirstName() 
				+ " " + candidate.getPerson().getLastName() + "\n");
		log.debug("Getting home phone...");
		resume.append(candidate.getPerson().getContactInfo().getHomePhone() + "\n");
		log.debug("Getting address...");
		Address homeAddress = candidate.getPerson().getContactInfo().getHomeAddress();
		if (homeAddress != null) {
			resume.append(homeAddress.getAddress1() + "\n");
			resume.append(homeAddress.getCity() + ", " + homeAddress.getState()
					+ " " + homeAddress.getPostalCode() + "\n");
		}
		
		resume.append("I have the following skills: \n");
		for (int i = 0; i < numberOfWords; i++) {
			int skillIndex =  (int)(Math.random() * skillListSize);
			
			String word = (String)skillList.elementAt(skillIndex);
			resume.append(word + "\r\n");
		}
		
		return(resume.toString());
	}



}
